﻿using System;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;

namespace Pakxel.SmartLogistic.Reportes
{
    public partial class Reportes : Form
    {
        public Reportes()
        {
            InitializeComponent();
            Parametros = new System.Collections.Hashtable();
            //Tablas = new System.Collections.Hashtable();
        }

        public ReportClass Reporte
        { get; set; }

        public System.Collections.Hashtable Parametros
        { get; private set; }

        //public System.Collections.Hashtable Tablas
        //{ get; private set; }

        private void Reportes_Load(object sender, EventArgs e)
        {
            if (!DesignMode)
            {                
                CRPMain.ReportSource = Reporte;
                foreach (string itm in Parametros.Keys)
                    Reporte.SetParameterValue(itm, Parametros[itm]);
                //foreach (string itm in Tablas.Keys)
                //    Reporte.Database.Tables[itm].SetDataSource(Tablas[itm] as System.Collections.IEnumerable);
            }
        }
    }
}
